import { mapGetters } from "vuex";
// import titlemixins from "@/mixins/bigScreen/titlemixins";
let mixin = {

  // mixins: [titlemixins],

  props: {
    classes: {
      default: function() {
        return {};
      }
    },
    componentDetail: {
      default: function() {
        return {}
      }
    },

  },
  computed: {
    ...mapGetters(["scale"])
  },
  data() {
    return {
      logo: 100,
      scalecom: 1,
    };
  },
  mounted() {
    if (this.componentDetail['scale']) {
      this.scalecom = this.componentDetail['scale']
    }
  },
  methods: {

    //获取componentDetail属性
    getprop(propname){
      if (this.componentDetail[propname]) {
        return this.componentDetail[propname]
      }else{
        return ''
      }
    },

    //获取自适应像素
    getscalepxc(val) {
      return this.scale * val* this.scalecom + "px";
    },

    getscalepx(val) {
      return this.scale * val* this.scalecom + "px";
    },

    //获取自适应数值
    getscalepxcnum(val) {
      return this.scale * this.scalecom * val;
    },

    //获取自适应宽高
    getsamewh(val) {
      return {
        height: this.getscalepxc(val),
        width: this.getscalepxc(val)
      };
    },

    //获取自适应字体大小
    getfontSize(val) {
      return {
        fontSize: this.getscalepxc(val),
      };
    },

    //获取两个px
    getpmtwo(one,two){
      return this.getscalepxc(one) + ' ' + this.getscalepxc(two) + ''
    },
    //获取四个px
    getpmfour(one, two, three, four){
      return this.getscalepxc(one) + ' ' + this.getscalepxc(two) + ' '+ this.getscalepxc(three) + ' ' + this.getscalepxc(four) + ''
    },

    /**
     * 获取各种颜色
     */
    getfonttitle(){
      return 'white'
    },
    getfontcontent(){
      return '#AED2E2'
    },
    getfontunit(){
      return '#77D2FF'
    },
    getbackcolor(){
      return '#072750'
    }
  }
};

export default mixin;
